package main

import (
	"fmt"
)

func main() {
	var c1, c2, c3 chan int
	var i1, i2 int
	select {
	case i1 =<-c1:
		fmt.Printf("received", i1, "form c1\n")
	case c2 <- i2:
		fmt.Printf("sent",i2," to c2\n")
	case i3,ok:=(<-c3):
		if ok{
			fmt.Printf("received",i3," form c3\n")
		}else{
			fmt.Printf("c3 is closed\n")
		}
		default:
			fmt.Printf("no communication\n")
	}
	/*var i int
	for ;i<=5;i++	{
		fmt.Println(i)
	}*/
	/*for j:=1;;j++{
		fmt.Println(j)
		if j==10 {
			break
		}
	}*/
	/*for k:=1;k<=10;{
		fmt.Println(k)
	}*/
	/*var z int
	for z<=10 {
		fmt.Println(z)
	}*/
	/*var z int
	for ;;z++ {
		fmt.Println(z)
	}*/

	/*for {
		fmt.Println("1")
	}*/
	//map1:="f3t2yt23r32t"
	var b,a = 15,0
	numbers:=[6]int{1,2,3,5}

	for a=0;a<10;a++{
		fmt.Printf("a的值为：%d\n",a)
	}
	for a<b {
		fmt.Print(a)
		a++ //10,
		fmt.Printf("a的值为：%d\n",a)
	}
	for i,x:=range numbers {
		fmt.Printf("第 %d 位　x 的值＝%d\n",i,x)
	}

	for i:=1;i<=10;i++{
		if i>5 {
			break
		}
		fmt.Printf("%d\n",i)
	}
	//此程序将输出13579
	out:for i:=1;i<=5;i++{
	for j:=1;j<=5;j++{
			if j==3{
				//break out
				continue out
			}
			fmt.Printf("i:%d,j:%d\n",i,j)
		}

	}

	var a1 int =10

	LOOP:for a1<20 {
		//fmt.Println(a1)
		if a1==15 {
			a1=a1+1
			goto LOOP
		}
		fmt.Printf("A的值为：%d\n",a1)
		a1++
	}


}
